import { ArgumentMetadata, Injectable, PipeTransform } from '@nestjs/common';

@Injectable()
export class AppPipe implements PipeTransform {
  constructor(private readonly from: string) {}

  transform(value: any, metadata: ArgumentMetadata) {
    console.log(
      `AppPipe in ${this.from}`,
      JSON.stringify(metadata),
      JSON.stringify(value || ''),
    );
    return value;
  }
}
